/*
 * Tree.cpp
 *
 *  Created on: 24.10.2012
 *      Author: Martin
 */

#ifdef _WIN32 
#include <windows.h> 
#endif

#include "Tree.h"

Tree::Tree(glm::vec3 _Pos, float _r, std::string _Name, std::string _modelFName,
		ModelPool *_mPool, PathFinder *_pathfinder) :
		Vegetation(_Pos, _r, _Name, _modelFName, _mPool, _pathfinder)
{
	type = OBJ_TREE;
	parentType = OBJ_VEGETATION;

	age = 15.0;

	//pathfinder->ReservePosition((int)Pos.x , (int)Pos.z, this);

	BuildUnitBar("tree_char.png");
}

Tree::~Tree()
{
}

void Tree::control(float t)
{
	// exit when unit is sleeping
	if (sleeping)
		return;

	// increase tree age
	if (timer.GetInterval(10000))
		if (age < 100.0)
		{
			age = age + 0.5;
		}
}
